{% set location = 'post' %}
{% extends "layout.html" %}
{% from "_page.html" import message %}
{% block title %}
Edit Post
{% endblock %}
{%- block css %}
<link media="all" rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/simditor/externals/font-awesome/css/font-awesome.css')}}" />
<link media="all" rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/simditor/styles/simditor.css')}}" />
{%- endblock %}
{%- block js %}
<script type="text/javascript" src="{{ url_for('static', filename='lib/simditor/externals/jquery-2.0.3.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='lib/simditor/lib/module.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='lib/simditor/lib/uploader.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='lib/simditor/lib/simditor.js')}}"></script>
<script type="text/javascript">
    $(function() {
        var editor = new Simditor({
            textarea: $('#body'),
            placeholder: '这里输入文字...',
            pasteImage: true,
            toolbar: ['bold', 'italic', 'underline', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr'],
            upload: {
                url: '/backstage/media/upload'
            }
        });
    });
</script>
{%- endblock %}
{% block content %}
<form class="form-horizontal" method="post">
    <fieldset>
    {{ form.hidden_tag() }}
    <div class="control-group">
        {{form.title.label(class="control-label")}}
        <div class="controls">
        {{form.title(size=50, class="input-xlarge" )}}
        </div>
    </div>
    <div class="control-group">
        {{form.body.label(class="control-label")}}
        <div class="controls">
        {{form.body(style="width:700px;height:500px;")}}
        </div>
    </div>
    <div class="form-actions">
        {{ form.submit(class="btn btn-primary") }}
    </div>
    </fieldset>
</form>
{% endblock %}